some cleanups, removed closures
added a bytesreceived counter