Style fixes pointed out by Axel. I'm rusty, and it shows. Hope I got it right. Also moved get_route() into BPrivate.
Moved common code to a private file.