Experts say light and time aren’t as important as temperature, reports The Wall Street Journal.

“People tend to set their ambient house or bedroom temperature a little higher than is actually optimal for sleep,” says Matthew Walker, a professor of neuroscience and psychology at the University of California, Berkeley.

The body’s core temperature needs to drop by about 2 to 3 degrees Fahrenheit to initiate sleep, Dr. Walker says. “If our core temperature is too high the brain cannot easily make the switch from being awake to being asleep, or create the best quality sleep.”

Core body temperature is the temperature of our heat-producing core, which is the brain and abdominal cavity. As the ambient temperature drops, so too does our core temperature. It usually reaches the lowest level in the early morning hours, before awakening.