Refactor API of deps-graph