separating client and server code