Bariatric surgery, which is used to treat people with obesity, is more effective at treating type 2 diabetes than just medication, a new study says.

Cleveland Clinic researchers have shown in a study published in The New England Journal of Medicine that bariatric surgery is highly effective in treating type 2 diabetes patients. The majority of patients who underwent the surgery were able to be free of insulin and all their diabetes medications three years post-surgery.

Obesity is one of the primary causes of type 2 diabetes, so it’s not entirely surprising that weight loss could impact a patient’s diabetes. One hundred and fifty patients enrolled in the study, known as STAMPEDE (Surgical Therapy and Medications Potentially Eradicate Diabetes Efficiently) trial. Participants were overweight or mildly obese, and had difficulty controlling their diabetes. The researchers split the participants into three treatment groups: standard medicinal therapy; gastric bypass surgery; and sleeve gastrectomy, another type of bariatric surgery. Effectiveness was gauged by the individual’s ability to control their blood sugar.

Three years after surgery, more patients in the gastric bypass group were able to achieve blood sugar control without diabetes medication compared to the other two groups. And patients in the sleeve gastrectomy group were able to better control blood sugar than patients in the medication group. “More than 90 percent of the patients who underwent bariatric surgery were able to lose 25 percent of their body weight and control their diabetes without the use of insulin and multiple diabetes drugs,” said lead investigator Dr. Sangeeta Kashyap, an endocrinologist at the Cleveland Clinic in a statement.

Although the researchers determined their findings at the three year mark, major improvements were seen in some patients immediately after surgery. Some patients had total insulin control even just hours post-surgery or a few days later.

Insurance typically covers weight-loss surgeries in people with a body mass index (BMI) over 35, which is considered severely obese. However, if the new findings hold true, it may call for a change since type 2 diabetes accounts for about 95% of diagnosed diabetes in adults, according to the CDC. If the treatment is that effective, the researchers argue it ought to be more accessible.

Contact us at letters@time.com.