template compiling