simplify code using DepGraph.outgoing-edges