Heatmap: small refactoring