Improve template registry example by using precompiled templates