Factor out getUrl and fix for string placeholders