Rearrange global functions