refactor resource router