Rearrange dependencies properly