move StateMachine out of the global scope

so it doesn't conflict with other StateMachines