         guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: PageHistoryFilterCountCollectionViewCell.identifier, for: indexPath) as? PageHistoryFilterCountCollectionViewCell else {
             return UICollectionViewCell()
         }
-        let Count = counts[indexPath.item]
-        cell.configure(with: Count.title, image: Count.image, imageText: displayCount(Count.count), isRightSeparatorHidden: indexPath.item == counts.count - 1)
-        cell.apply(theme: theme)
-        collectionViewHeightConstraint.constant = max(collectionViewHeightConstraint.constant, cell.frame.height)
+        configure(cell, at: indexPath)
         return cell
     }
+
+    private func configure(_ cell: PageHistoryFilterCountCollectionViewCell, at indexPath: IndexPath) {
+        let count = counts[indexPath.item]
+        cell.configure(with: count.title, image: count.image, imageText: displayCount(count.count), isRightSeparatorHidden: indexPath.item == counts.count - 1)
+        cell.apply(theme: theme)
+    }
+
 }
 
 extension PageHistoryFilterCountsViewController: Themeable {

        super.viewWillTransition(to: size, with: coordinator)
        coordinator.animate(alongsideTransition: { _ in
            self.collectionView.collectionViewLayout.invalidateLayout()
            self.updateLayout()
        })
    }

    private func updateLayout(countOfColumns: Int = 4) {
        flowLayout.scrollDirection = .horizontal
        flowLayout.minimumInteritemSpacing = 0
        flowLayout.sectionInset = .zero
        flowLayout.minimumLineSpacing = 0
        let countOfColumns = CGFloat(countOfColumns)
        let availableWidth = collectionView.bounds.width - flowLayout.minimumInteritemSpacing * (countOfColumns - 1) - collectionView.contentInset.left - collectionView.contentInset.right - flowLayout.sectionInset.left - flowLayout.sectionInset.right
        let dimension = floor(availableWidth / countOfColumns)
        flowLayout.itemSize = CGSize(width: dimension, height: collectionViewHeightConstraint.constant)
    }

    private var flowLayout: UICollectionViewFlowLayout {
        return collectionView.collectionViewLayout as! UICollectionViewFlowLayout
    }
}


            if case let minorEdits?? = editCounts[.minor] {
                counts.append(Count(title: WMFLocalizedString("page-history-minor-edits", value: "minor edits", comment: "Text for view that shows many edits were marked as minor edits"), image: UIImage(named: "m")!, count: minorEdits))
            }
            countOfColumns = CGFloat(counts.count)
            delegate?.didDetermineFilterCountsAvailability(!counts.isEmpty, viewController: self)
        }
    }
