refactor clients
refactor server