Refactored the findUciEnginesIn function