break header reading into separate file