Refactored problem finding to be defined in each pass