rearrange and tidy