Rework how templates are initialized.