Fixed up state classes and state transitions