Some code rearrangements.
Some code rearrangements.