Refactor XML-RPC client