separated client and server logic