refactor(findFailedElements): refactor to use .map to traverse scopeElements