Better header parsing