Added setTemplate helper