DictionaryInjection: handle enumerations. Also refactored because of gigantic method.