improved remote url formation