move networking to one file