Rearrange functions for clarity