Code for templating.