Simplify the templating implementation