class-subclass refactoring working