Refactoring to use React Router