better header key handling