more cleanup of network code