Added custom template functionality