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

    (if (current-buffer-saved buffer)
	(if (y-or-n-p "Show record fields with default values?")	    
	    (erl-spawn
	      (erl-send-rpc wrangler-erl-node 'emacs_refac 'normalise_record_expr(list current-file-name line-no column-no 'true wrangler-search-paths tab-width))
	      (erl-receive (line-no column-no current-file-name)
		  ((['rex ['badrpc rsn]]
		    (message "Refactoring failed: %S" rsn))

        (column-no         (current-column-no))
	(buffer (current-buffer)))       
    (erl-spawn
      (erl-send-rpc wrangler-erl-node 'emacs_wrangler '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))
