added the templating.