factor out the download actions.