Updated networking to use NIO