use of inheritance templates