     ///
     /// - Parameter realm: a realm instance
     private init(realm: Realm, filteredClasses: [String]?) {
-        self.realm = realm
-        self.filteredClasses = filteredClasses
+        engine = BrowserEngine(realm: realm, filter: filteredClasses)
         super.init(nibName: nil, bundle: nil)
         title = "Realm Browser"
         filterOptions.selectedSegmentIndex = 0

        id.title = ascending == false ? RBSSortStyle.descending.rawValue: RBSSortStyle.ascending.rawValue
        ascending.toggle()
        if ascending {
            objects = objects.sorted { $0.className > $1.className }
        } else {
            objects = objects.sorted { $0.className < $1.className }
        }
        realmBrowserView.tableView.reloadData()
    }

    @objc public func filterBaseModels(_ id:UISegmentedControl) {
        let segmentedControl = id
        switch segmentedControl.selectedSegmentIndex {
        case 0:
            fetchObjects()
            realmBrowserView.tableView.reloadData()
        case 1:
            objects = objects.filter({
                !$0.className.hasPrefix("RLM") &&
                    !$0.className.hasPrefix("RealmSwift") })
            realmBrowserView.tableView.reloadData()
        default:
            return
        }
    }

    // MARK: - TableView Datasource & Delegate

    /// TableView DataSource method
    /// Asks the data source for a cell to insert in a particular location of the table view.

    ///   - indexPath: NSIndexPath
    /// - Returns: a UITableViewCell
    public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        guard let cell = tableView.dequeueReusableCell(withIdentifier: RealmObjectBrowserCell.identifier) else {
            fatalError("Error: Could dequeue tableViewCell as \(RealmObjectBrowserCell.self)")
        }
        if let cell = cell as? RealmObjectBrowserCell {
            let objectSchema = engine.objectSchema(at: indexPath.row)
            let className = engine.className(for: objectSchema)
            let count = engine.objectCount(for: objectSchema)
            cell.updateWith(title: className, detailText: "Objects in Realm = \(count)")
        }
        return cell
    }
}
