Rearrange inline function to appear before they are used.