refactored routing scheme