Better state encapsulation. Heatmap mode works better now.