caa_download: cleanup code