Refactoring base classes a little bit