Simplifying some of the code behind the dictionary