         return NumberFormatter.localizedThousandsStringFromNumber(NSNumber(value: count))
     }
 
+    private lazy var collectionViewHeightConstraint = collectionView.heightAnchor.constraint(equalToConstant: 60)
+
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        // TODO: Move out into separate types
         collectionView.dataSource = self
         collectionView.register(UINib(nibName: "PageHistoryFilterCountCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: PageHistoryFilterCountCollectionViewCell.identifier)
 
-        // TODO: Adjust height for the highest cell
-        let collectionViewHeightConstraint = collectionView.heightAnchor.constraint(equalToConstant: 60)
         collectionViewHeightConstraint.isActive = true
+
         view.wmf_addSubviewWithConstraintsToEdges(collectionView)
         addActivityIndicator()
         activityIndicator.style = theme.isDark ? .white : .gray
         activityIndicator.startAnimating()
-        updateLayout(collectionViewHeightConstraint.constant)
+        updateLayout()
         apply(theme: theme)
     }
 

            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: "reverted")!, count: minorEdits))
            }
            updateLayout(60, countOfColumns: counts.count)
            delegate?.didDetermineFilterCountsAvailability(!counts.isEmpty, viewController: self)
        }
    }

        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)
        return cell
    }
}
