Code rearrange