Refactor HeatMap