Refactored client/server code into the net library