refactor some routes