Added custom templating functionality