Refactor xmlrpc