Removed unnecessary complexity in routing calculations.