refactored step 4 to use dynamic routes