clean up network code