changed template functionality