refactored node routing a little bit