move networking code