reducing calls to map