rearrange code format