Moved brunt of network functions into util