transfere state machine to own file