[PATCH v2 6/8] remote_driver: Move URI re-generation into a function