compile templates once at startup