packaging: Shuffle functions around to make clearer