implemented templating