template hooks