refactor dependency graph