Factor out torrent downloading