Rearrange functions a bit