Rearrange so that deps are together.