Condense mutually recursive functions in EchoClient