template logic change