added some more functionality for template inheritance