rebuild templates