adding template support