refine header loading from file