cleaned up network functions