new state machine format using enum