(refactoring) Rearrange the code layout.