rearrange source code layout