Start moving client and server functions to classes for a cleaner design