Finding dependency and patching the imports.