Refactored base classes to make them more consistent.