Messing around with inheritance and templates