Refactor URL command (no functional change).