refactoring for simpleRouter