performed test refactorings;removed code repetition