Code refactoring and introduction of Visitor pattern for url segments.