VX(Li): Share common infrastructure between DFS and BFS.