save the templates in a root file and smooth the spikes