Refactor core:download
Add debug messages for core:download