finish refactoring handling HTTP headers by implementing much better normalization