fixed header parser to be more generic