added getTemplateObj method.