refactored how url paths are calculated