added setTemplate method
trailing spaces