         (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))))))

	(end-col-no    (current-column-pos end)))
    (if (current-buffer-saved buffer)
  	(erl-spawn
	  (erl-send-rpc wrangler-erl-node 'emacs_refac 'intro_new_var
			(list current-file-name start-line-no start-col-no end-line-no (- end-col-no 1) name tab-width))
	  (erl-receive (start-line-no start-col-no end-line-no end-col-no name current-file-name)
	      ((['rex ['badrpc rsn]]
		(message "Refactoring failed: %S" rsn))
	       (['rex ['error rsn]]

                            (setq instances_to_gen (get_instances_to_gen instances_in_clause buffer highlight-region-overlay)))
                          (erl-spawn
                            (erl-send-rpc wrangler-erl-node 'wrangler_refacs 
                                          'try_refac (list 'refac_gen 'gen_fun_clause
                                                                 (list current-file-name parname funname arity 
                                                                       defpos exp tab-width 'true instances_to_gen 
                                                                       editor logmsg)))
