refactored headers (un)escaping