added template functionality