Add header parsing logic