Refactoring to bring back in #define for states