Overhauls state machine for command modes