DRY up Host header extraction