Refactoring URL class