Restoring PR 3455 functionality
Merge pull request #3468 from yurydelendik/download-refactor

Restoring PR 3455 functionality