Generalizing sanitize.sh script