PEP-8, Python Zen, refactor and reduce code (part 9 in master module/network)