sort dependencies for injection