Refactored first test to remove duplication.