Separated server-client code