downloads refactoring