private static void refreshAndSave(AbstractProject template, ImplementationBuildWrapper implementationBuildWrapper, XmlFile implementationXmlFile, String oldDescription, boolean oldDisabled, Map<TriggerDescriptor, Trigger> oldTriggers) throws IOException {
		TopLevelItem item = (TopLevelItem) Items.load(Jenkins.getInstance(), implementationXmlFile.getFile().getParentFile());
		if(item instanceof AbstractProject) {
			AbstractProject newImplementation = (AbstractProject) item;

			//Use reflection to prevent it from auto-saving
			ReflectionUtils.setField(newImplementation, "description", oldDescription);
			ReflectionUtils.setField(newImplementation, "disabled", oldDisabled);
            //To resolve the issue #5 cast to List and not to Vector
            List<Trigger> triggers = ReflectionUtils.getField(List.class, newImplementation, "triggers");
            triggers.clear();
            for (Trigger trigger : oldTriggers.values()) {
                triggers.add(trigger);
            }

			DescribableList<BuildWrapper, Descriptor<BuildWrapper>> implementationBuildWrappers = ((BuildableItemWithBuildWrappers) newImplementation).getBuildWrappersList();
			CopyOnWriteList data = ReflectionUtils.getField(CopyOnWriteList.class, implementationBuildWrappers, "data");

			//strip out any template definitions or implementation definitions copied from the template
			List<BuildWrapper> toRemove = new LinkedList<BuildWrapper>();
			for (BuildWrapper buildWrapper : implementationBuildWrappers) {
				if(buildWrapper instanceof TemplateBuildWrapper) {
					if(template.getName().equals(((TemplateBuildWrapper) buildWrapper).getTemplateName())) {
						toRemove.add(buildWrapper);
					}
				} else if(buildWrapper instanceof ImplementationBuildWrapper) {
					toRemove.add(buildWrapper);
				}
			}
			for (BuildWrapper buildWrapper : toRemove) {
				data.remove(buildWrapper);
			}

			//make sure the implementation definition is still in there
			data.add(implementationBuildWrapper);

			newImplementation.getConfigFile().write(newImplementation); //don't call save() because it calls the event handlers.
			item = (TopLevelItem) Items.load(Jenkins.getInstance(), implementationXmlFile.getFile().getParentFile());

			putItemInJenkins(Jenkins.getInstance(), item);
		}
	}