loadTemplate method