beginning of refactor of bit torrent client