makeUrl, refactoring