template insertion