Removed state machine code