rearrange the code layout