organizing server/client code