refactoring for multi-peer download