Rearrange directory structure into modules