refactored downloading
refactored downloading