Add code used in templates.