refactor response headers normalization into it's own method