condensed processDependencies function