refactor cache_or_download