separate bfs and bfs/generic