added template nesting