Routing file tidy up

Broke out some some of the methods in routing file.

simplified adjacent node search.