modular version with server and client tests