Refactor URL construction to use pre-configured URIs if available, otherwise fallback to default scheme and host.