Should adopt a trick from minia during DFS traversal