rework client and server communicatoin