Refactored headers_parser