refactoring base class