generic trick for superclass to return subclasses