modernized client and server code