finalizing the templates