functional solution for method_name