Every athlete knows that sleep is a key aspect of recovery, but how many people actually get a perfect night’s rest? According to the National Institutes of Health, about 30 percent of Americans complain about sleep, and 10 percent have symptoms that align with insomnia. There are plenty of possible causes, but a new study published in the American Journal of Clinical Nutrition found that there may be an unexpected culprit for some cases of insomnia: a person’s diet. Specifically, a diet high in refined carbs and added sugars could be to blame.

Researchers at Columbia University Vagelos College of Physicians and Surgeons looked at data from more than 50,000 postmenopausal women from the Women’s Health Initiative and found that those who ate a diet high in refined carbs, especially added sugars, were more likely to suffer from insomnia. Those who ate more veggies, fiber, and whole fruits were less likely to have issues with insomnia.

It’s important to note that it’s not carbs in general, but refined carbs, that were found to affect sleep. Foods with higher glycemic indexes—think added sugars, white rice, or soda—spike blood sugar, and it’s that quick spike in blood sugar that researchers think might contribute to insomnia. Although fruits contain natural sugars, Gangwisch pointed out that the fiber in them helps prevent blood sugar from spiking.

“When blood sugar is raised quickly, your body reacts by releasing insulin,” James Gangwisch, Ph.D. and senior study author, said in a release. “The resulting drop in blood sugar can lead to the release of hormones such as adrenaline and cortisol, which can interfere with sleep,” he explained. Highly processed foods contain more refined sugars that aren’t found in nature, and those are the ones that trigger blood sugar spikes.

Athough the study was done on postmenopausal women, the authors think that the findings may hold true in the general population because most people, regardless of age or gender, experience a spike in blood sugar after eating refined carbs. That said, more research is necessary to find out for sure.

“Based on our findings, we would need randomized clinical trials to determine if a dietary intervention, focused on increasing the consumption of whole foods and complex carbohydrates, could be used to prevent and treat insomnia,” Gangwisch said.