Rearrange and broader logic.