         (column-no         (current-column-no))
 	(buffer (current-buffer)))
     (if (buffers-saved)
-        (erl-refactor-rename-var-1 current-file-name line-no column-no name wrangler-search-paths tab-width 'emacs)
+        (erl-refactor-rename-var-1 current-file-name line-no column-no name wrangler-search-paths 'emacs tab-width)
       (message "Refactoring aborted."))))
 
    
-(defun erl-refactor-rename-var-1(current-file-name line-no column-no name wrangler-search-paths tab-width editor)
+(defun erl-refactor-rename-var-1(current-file-name line-no column-no name wrangler-search-paths editor tab-width)
   "Rename an identified variable name."
   (setq composite-refac-p (equal editor 'composite_emacs))
   (erl-spawn
-    (erl-send-rpc wrangler-erl-node 'emacs_refac 'rename_var 
-                  (list current-file-name line-no column-no name 
-                        wrangler-search-paths tab-width editor))
+    (erl-send-rpc wrangler-erl-node 'emacs_wrangler 'apply_refac 
+                  (list 'rename_var 
+                        (list current-file-name line-no column-no name 
+                              wrangler-search-paths editor tab-width)
+                        wrangler-search-paths))
     (erl-receive (line-no column-no current-file-name)
         ((['rex result]
           (process-result current-file-name result line-no column-no composite-refac-p))))))

        (column-no         (current-column-no))
	(buffer (current-buffer)))       
    (erl-spawn
      (erl-send-rpc wrangler-erl-node 'emacs_refac 'add_a_tag(list current-file-name line-no column-no name wrangler-search-paths tab-width))
      (erl-receive (buffer name current-file-name)
	  ((['rex ['badrpc rsn]]
	    (message "Refactoring failed: %S" rsn))

               (with-current-buffer (get-file-buffer-1 current-file-name)
                 (setq instances_to_gen (get_instances_to_gen instances buffer highlight-region-overlay)))
               (erl-spawn
                 (erl-send-rpc wrangler-erl-node 'wrangler_refacs 'try_refac (list 'refac_gen 'gen_fun_1
                                                                                         (list side_effect current-file-name parname 
                                                                                               funname arity defpos exp search-paths 
                                                                                               tab-width instances_to_gen editor logmsg)))
