Implement header parsing