refactoring download