I also though about making a helper function, but as this function depends on the type of the object, currently using the default implementation for everything but TemplateInstance there would be the need to do a typecheck inside this helper functions, involving a dynamic cast or some kind of tagging. Because of that I used a virtual function.