normalizing templates