refactoring string to enum