Better separation of server and client code