Refactoring astar-BFS, plumbing