moved StateMachine.buildEvent method to StateMachine#doTransition