move url config fetch into the function