refractored the getFavHeap code