move subclass loading into method