refactored multiple classes and tests