checks sha256 if the dest file is given and exists
extract reusable logic to a function
attempt to validate existing file with the sha256sum before downloading it
move module checks to after `module` is defined