Move all network stuff to a separate module