refactoring inheriting base class