Refactored functional test after applying DRY