Refactored dynamic url code
Refactored dynamic url code