thin and rearrange directories