refactored class defs to use subclasses