Refactored Enum module to be more generic.