Common code shared across the client and the server