heatmap app refactred