Refactored downloading resources