Networking refactoring