improve state machine for user