refactoring method_name and error log