rearrange function order