Extract code from network.py into two different files.
Delete network.py file
Minor code reformation.