             return
         }
         // Sort facets: first selected facets, then by decreasing count, then by name.
-        let receivedQueryHelper = QueryHelper(query: results.lastQuery)
         genreFacets = results.facets("genre")?.sort({ (lhs, rhs) in
             // When using cunjunctive faceting ("AND"), all refined facet values are displayed first.
             // But when using disjunctive faceting ("OR"), refined facet values are left where they are.
             let disjunctiveFaceting = results.disjunctiveFacets.contains("genre") ?? false
-            let lhsChecked = receivedQueryHelper.hasFacetRefinement(FacetRefinement(name: "genre", value: lhs.value))
-            let rhsChecked = receivedQueryHelper.hasFacetRefinement(FacetRefinement(name: "genre", value: rhs.value))
+            let lhsChecked = self.movieSearcher.hasFacetRefinement("genre", value: lhs.value)
+            let rhsChecked = self.movieSearcher.hasFacetRefinement("genre", value: rhs.value)
             if !disjunctiveFaceting && lhsChecked != rhsChecked {
                 return lhsChecked
             } else if lhs.count != rhs.count {

            case genreTableView:
                let cell = tableView.dequeueReusableCellWithIdentifier("genreCell", forIndexPath: indexPath) as! GenreCell
                cell.value = genreFacets[indexPath.item]
                cell.checked = QueryHelper(query: movieSearcher.results!.lastQuery).hasFacetRefinement(FacetRefinement(name: "genre", value: genreFacets[indexPath.item].value))
                return cell
            default: assert(false); return UITableViewCell()
        }

    }
    
    @IBAction func genreFilteringModeDidChange(sender: AnyObject) {
        movieSearcher.setFacet("genre", disjunctive: genreFilteringModeSwitch.on)
        search()
    }
    
