Refactor dry-run impl to be more generic about purpose