Refactored Client and Server's common code into NetworkCommunicator superclass