make the scripts for the patches more generic