refactored torrent as a gen_server