Replaces HashMap by EnumMap where the key is an enum

Replaces HashMap by EnumMap where the key is an enum, as EnumMap maps have better performance and memory characteristics for enum keys.