Work on state machine def.