State change process & state machine refactoring