separated code for client-server without encapsulation