renamed renderTemplate() to initTemplate()