Cleaning up network code