Use machineState to manage transitions