refactoring base classes