Rearrange and DRY it.