Refactored existing classes and tests.