Rearrange code in new packages