Module rearrangement, and cleanup