refactor(Agent): Move static func map out of loop