refactor router and modify some tests