BFS prerequisites and tidy up of resched functions