REDTEST-0028: code refactoring.