finalizing templates