5. Refactored step #4 to use dynamic routes