refactors routes to remove deprecation warnings