Refactoring Digraph