And a small refactor to reduce the LOC in the onHeadersReceived callback, to improve the readability of the code.