started building template functionality