Refactor fetching the dependency