Factored out common code in getDeps and getVersions