The conditional expressions that control an object’s state transitions are complex.
Replace the conditionals with State classes that handle specific states and transitions between them.