Refactoring: move shared code stubs to server/client.