added inheritance for templates