Refactor authorization HTTP header management