refactored multiple classes