added template inheritance