Refactoring of enum classes