refactoring state names in controller