Polish the state machine some more