Move client and server to use protocol