use polymorphism template