various clean ups in client-server communication