introduce StateMachine class