Refactored routing class and tests