Header updates and code rearrangement