refactored StateMachine object, removed some features