User state machine