StateMachine class simplification