Refactor renderTrackerIcon function