   ///   to query the cell using the old index path, and update the cell with
   ///   data from the new index path.
   public func performUpdates(records: [CollectionRecord], update: TableViewUpdateCallback? = nil) {
+    var changeRecords: [CollectionRecord] = []
+
     self.beginUpdates()
     for record in records {
       switch record {

        let indexPath = NSIndexPath(forRow: to.index, inSection: to.section)
        let fromIndexPath = NSIndexPath(forRow: from.index, inSection: from.section)
        self.moveRowAtIndexPath(fromIndexPath, toIndexPath: indexPath)
      case let .ChangeItem(from, to):
        let indexPath = NSIndexPath(forRow: to.index, inSection: to.section)
        let fromIndexPath = NSIndexPath(forRow: from.index, inSection: from.section)
        if let updateCallback = update {
          updateCallback(from: fromIndexPath, to: indexPath)
        } else {
          self.reloadRowsAtIndexPaths([fromIndexPath], withRowAnimation: .Automatic)
        }
      case let .ReloadSection(section):
        self.reloadSections(NSIndexSet(index: section), withRowAnimation: .Automatic)
      case let .MoveSection(section, from):

      }
    }
    self.endUpdates()

    if changeRecords.count > 0 {
      self.beginUpdates()
      for record in changeRecords {
        guard case let .ChangeItem(from, to) = record else {
          return fatalError("changeRecords can contain only .ChangeItem, not \(record)")
        }

        let indexPath = NSIndexPath(forRow: to.index, inSection: to.section)
        let fromIndexPath = NSIndexPath(forRow: from.index, inSection: from.section)
        if let updateCallback = update {
          updateCallback(from: fromIndexPath, to: indexPath)
        } else {
          self.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
        }
      }
      self.endUpdates()
    }
  }
}
