refactor router component