Encapsulate it in a method and give the method the class to walk the subclass tree for to create new objects.