Enhanced header parsing