Rearrange code in modules