Refactoring to an enum