Networking code cleanup