anchor.diff:      NewNameStr = atom_to_list(NewNameAtom),
       Pid = refac_atom_utils:start_atom_process(),
       ?wrangler_io("The current file under refactoring is:\n~p\n", [FileName]),
  -    {AnnAST1, _C} = do_rename_fun(AnnAST, {Mod, OldFunNameAtom, Arity}, {DefinePos, NewNameStr}),
  +    {AnnAST1, _C} = do_rename_fun(AnnAST, {Mod, OldFunNameAtom, Arity}, {DefinePos, NewNameAtom}),
       refac_atom_utils:check_unsure_atoms(FileName, AnnAST1, [OldFunNameAtom], f_atom, Pid),
       case refac_misc:is_exported({OldFunNameAtom, Arity}, Info) of
   	true ->
   	    ?wrangler_io("\nChecking possible client modules in the following search paths: \n~p\n", [SearchPaths]),
  -	    ClientFiles = refac_util:get_client_files(FileName, SearchPaths),
  +	    ClientFiles = wrangler_modulegraph_server:get_client_files(FileName, SearchPaths),
   	    try
   		rename_fun_in_client_modules(ClientFiles, {Mod, OldFunNameAtom, Arity},
  -					     NewNameAtom, SearchPaths, TabWidth, Pid)
  +					     NewNameStr, SearchPaths, TabWidth, Pid)
   	    of
   		Results ->
   		    HasWarningMsg = refac_atom_utils:has_warning_msg(Pid),
   		    refac_atom_utils:output_atom_warning_msg(Pid, not_renamed_warn_msg(OldFunNameAtom), renamed_warn_msg(OldFunNameAtom)),
   		    refac_atom_utils:stop_atom_process(Pid),
  -		    refac_util:write_refactored_files([{{FileName, FileName}, AnnAST1}| Results],
  -						      HasWarningMsg, Editor, TabWidth, Cmd)
  +		    refac_write_file:write_refactored_files([{{FileName, FileName}, AnnAST1}| Results],
  +							    HasWarningMsg, Editor, TabWidth, Cmd)
   	    catch
   		throw:Err ->
   		    refac_atom_utils:stop_atom_process(Pid),
  
positive.code: -include("../include/wrangler.hrl").
  
  
  %%-spec(rename_fun/6::(string(), integer(), integer(), string(), [dir()], integer()) ->
  %%	     {error, string()} | {warning, string()} |{ok, [filename()]}).
  
  rename_fun(FileName, Line, Col, NewName, SearchPaths, TabWidth) ->
      rename_fun(FileName, Line, Col, NewName, SearchPaths, TabWidth, emacs).
  
  %%-spec(rename_fun_eclipse/6::(string(), integer(), integer(), string(), [dir()], integer()) ->
  %%				  {error, string()} | {warning, string()} | {ok, [{filename(), filename(), string()}]}).
  rename_fun_eclipse(FileName, Line, Col, NewName, SearchPaths, TabWidth) ->
      rename_fun(FileName, Line, Col, NewName, SearchPaths, TabWidth, eclipse).
  
  %%-spec(rename_fun_command/5::(modulename()|filename(), atom(), integer(), atom(),[dir()])->
  %%				       {error, string()} | {ok, [filename()]}).
  rename_fun_command(ModOrFileName, OldFunName, Arity, NewFunName,SearchPaths) ->
      OldFunNameStr=case is_atom(OldFunName) of 
  		      true ->atom_to_list(OldFunName);
  
negative.code: 	    HasWarningMsg = refac_atom_utils:has_warning_msg(Pid),
  	    refac_atom_utils:output_atom_warning_msg(Pid, not_renamed_warn_msg(OldFunNameAtom), renamed_warn_msg(OldFunNameAtom)),
  	    refac_atom_utils:stop_atom_process(Pid),
  	    refac_write_file:write_refactored_files([{{FileName, FileName}, AnnAST1}],
  						    HasWarningMsg, Editor, TabWidth, Cmd)
      end.
  
  -spec(rename_fun_1/6::(string(), integer(), integer(), string(), [dir()], integer()) ->
  	     {error, string()} | {ok, [filename()]}).
  rename_fun_1(FileName, Line, Col, NewName, SearchPaths, TabWidth) ->
      rename_fun_1(FileName, Line, Col, NewName, SearchPaths, TabWidth, emacs).
      
  -spec(rename_fun_1_eclipse/6::(string(), integer(), integer(), string(), [dir()], integer()) ->
  	     {error, string()} | {ok, [filename()]}).
  
  rename_fun_1_eclipse(FileName, Line, Col, NewName, SearchPaths, TabWidth) ->
      rename_fun_1(FileName, Line, Col, NewName, SearchPaths, TabWidth, eclipse).
  
  rename_fun_1(FileName, Line, Col, NewName, SearchPaths, TabWidth, Editor) ->
      Cmd = "CMD: " ++ atom_to_list(?MODULE) ++ ":rename_fun(" ++ "\"" ++ 
  	    FileName ++ "\", " ++ integer_to_list(Line) ++ 
  	      ", " ++ integer_to_list(Col) ++ ", " ++ "\"" ++ NewName ++ "\","
  									    ++ "[" ++ refac_misc:format_search_paths(SearchPaths) ++ "]," ++ integer_to_list(TabWidth) ++ ").",
      {ok, {AnnAST, Info}} = wrangler_ast_server:parse_annotate_file(FileName, true, SearchPaths, TabWidth),
      NewName1 = list_to_atom(NewName),
      {ok, {Mod, Fun, Arity, _, DefinePos}} = interface_api:pos_to_fun_name(AnnAST, {Line, Col}),
      ?wrangler_io("The current file under refactoring is:\n~p\n", [FileName]),
      Pid = refac_atom_utils:start_atom_process(),
      {AnnAST1, _C} = do_rename_fun(AnnAST, {Mod, Fun, Arity}, {DefinePos, NewName1}),
      case refac_misc:is_exported({Fun, Arity}, Info) of
  	true ->
  	    ?wrangler_io("\nChecking client modules in the following search paths: \n~p\n", [SearchPaths]),
  	    ClientFiles = wrangler_modulegraph_server:get_client_files(FileName, SearchPaths),
  	    try
  		rename_fun_in_client_modules(ClientFiles, {Mod, Fun, Arity}, NewName, SearchPaths, TabWidth, Pid)
  	    of
  		Results ->
  		    HasWarningMsg = refac_atom_utils:has_warning_msg(Pid),
  		    refac_atom_utils:output_atom_warning_msg(Pid, not_renamed_warn_msg(Fun), renamed_warn_msg(Fun)),
  		    refac_atom_utils:stop_atom_process(Pid),
  		    refac_write_file:write_refactored_files([{{FileName, FileName}, AnnAST1}| Results],
  							    HasWarningMsg, Editor, TabWidth, Cmd)
  	    catch
  		throw:Err -> Err
  	    end;
  	false ->
  	    HasWarningMsg = refac_atom_utils:has_warning_msg(Pid),
  	    refac_atom_utils:output_atom_warning_msg(Pid, not_renamed_warn_msg(Fun), renamed_warn_msg(Fun)),
  	    refac_atom_utils:stop_atom_process(Pid),
  	    refac_write_file:write_refactored_files([{{FileName, FileName}, AnnAST1}],
  						    HasWarningMsg, Editor, TabWidth, Cmd)
      end.
  
  
  