Improved get_method_name() parsing