Untangle client and server code