move commands out of DFS