Change `...the state of the UI and return a query condition...` to `...the state of the UI to return a query condition...` to remove repetitive ands.