shared code between the client and server