refactored to use dynamic routes