changed report array to map
changed report array to map
refactor to avoid fetching metrics more than once