replaced conditional statements checking dicts with .get() to 'key' in dict format.