Use finite state machine for client implementation