Minimize computation in Map