Reshuffle some functions around