Adding network stuff + cleanup