refactored routing component