Refactor test removing duplication