refactoring: tests code duplication elimintated