Redo of fixing templates structure.