Extract SectionSorter.

Start to make the code more explanatory.