refactor
BFS update