Test 4 refactored