before templates