refactored most called route calculator