Reorder statements to keep related operations together.