Replace map with inject method