Move substituteParametersInManifest() back to a separate function