improved syntax for sharing client and server code