Refactoring using enumeration.