refining communnication between client and server