Refactored URI factory.