clearing and renaming template files