Rework header logic