improve perfomance in map