Rearrange source code