A better server state machine