group the dependencies properly