That would definitely be an improvement. When I originally wrote this in 2011, I had just a few hours, so I went with the quickest solution. For little personal side projects like this I find that Redis makes a great persistent hash map for storing bits of data between runs of a script.