a lot of download refactoring