game state machine refine