moving the state machine to the sub classes
moving the state machine to the sub classes