Cleanup code and add network_prefix variable rather than hard-coding IPs in template