map_headers refactored

I refactored `map_headers`