using enummap instead enum

the EnumMap implementation can be much more efficient that those of other Maps.