Rearrange and refactor.