Add getHeader helper and move ToHeader to the cpp file.