Small code rearrangement