Add setTemplate method.