created new class and refactoring