rearrange functions for readablility