Merge pull request #4785 from tiennou/fix/cleanup-remote remote: store the connection data in a private struct