Added code to handle complex routing with branches