It’s three a.m., and you are up, rolling around, trying desperately to get some good sleep. But, your body is just saying NO!!!!!

We have all been there, especially me (during my paranoid time that I had schizophrenia, high-school state.) And the truth is, it probably is in our best interest to ensure that we aren’t making these five mistakes anymore.

For those who want some enlightenment, here is what keeps you awake at night.

1. Over Caffeinating Too Late

I, like any sane other human being, am a lover of caffeine and I’m sure you are too. Which means a couple of things.

We probably have a cup every morning. We might have a cup every noon. And we might be drinking way too much caffeine.

Caffeine is an amazing drug for the brain, helping to increase cellular metabolism, dull adenosine receptors, and all together cultivate a feeling of wakefulness. Plus, coffee is just so amazing that sometimes I wish that I could put a ring on it (okay not really.)

But, with the dulling of adenosine receptors (the reason you feel wired on caffeine) comes a problem that can seriously interfere with sleep. A decrease in the production of the neurotransmitter that helps us fall asleep, melatonin and with it the feeling of wakefulness.

Caffeine has a half-life of 8 hours (on average) and so when you have that last cup at four or five in the evening, odds are you will start to lose some of that precious sleep (or at least the quality) that you need.

*Rule 1: No Caffeine after 2 p.m.

2. Blue Light and Your Eyes

I know I know, you probably hear all the time not to be on your phone during bed anymore. And that is the truth.

So why aren’t you listening?

I have done it, and I do it still (because I use a bit of a hack), but you could be getting a lot more peaceful rest just by stopping the electronics 1-2 hours before bed. The blue light was initially only emitted by the sun, helping your body get rid of the melatonin in the bloodstream and start to get you ready for the day. Although, now LED lighting and every piece of electronic we have is always disrupting our production of melatonin.

The fact of the matter is, studies are showing blue light results in a decrease of half of the melatonin you could be producing every night and with it a disruption of how long it is in the bloodstream. That means worse sleep and less sleep. Two things we don’t want.

But, I have a little trick.

Blue light blocking glasses (only $10 on Amazon) block almost all of the harmful light and allow you to peruse the internet still after dark.

*Rule 2: Either Cut Electronics or Supplement With Blue Light

See Also: 4 Benefits of Mind Dumping to Help You Sleep

3. Keeping Light In Your Room

Again with light.

We need to get all of it out of the room when we sleep. Think about what it feels like having a light beam down on you, even with your eyes shut.

Remember when we were kids and outside glaring at the sun, we would close our eyes only to have still illuminated eyelids that project enough to “see” light? Well, that is exactly what happens when you continue to keep a light in your room.

Your mind and body don’t want to relax and fall asleep because there is light. Us humans are groomed to be awake when it is light. The presence of light in your room may be what keeps you awake at night.

There are many options to get rid of all the light.

Use a sleep mask

Get blackout curtains

Cover your windows with garbage bags

These solutions are simple but will seriously skyrocket your sleep through the roof.

*Rule 3: Sleep In Total Darkness

4. Exercising Too Late

What happens when you go for a run? You are probably wound up and ready to go literally.

We are very adaptable creatures, able to fight or flight in a second and running is quite literally flight. Your parasympathetic nervous system controls rest and digests while your sympathetic controls fight or flight. By running, you turn on your sympathetic and off your parasympathetic. This means your body is pumping adrenaline, cortisol and a whole host of stress hormones that keep you primed and wired for anything.

Now coming home and trying to get a good night sleep can seem impossible. We toss and turn, and it seems like something is wrong, while we can’t pinpoint it. As the stress hormones are depleted in the system, we slowly come down from that runner’s high and can get rest.

By pushing your workout earlier in the day, you will have already come down and will be amazingly primed for sleep.

*Rule 4: Exercise earlier in the day

5. Not Keeping It Cool

I hope you didn’t grow up in a household that wouldn’t ever touch the air conditioning. In the summer, it seemed like it was always scorching hot, while in the winter cold. This can be a traumatic point to our sleep.

The human body sleeps optimally at between 60 and 67 degrees Fahrenheit (3). Too hot and we are up all night, too cold and well we are freezing.

We know that feeling of having an insanely hot room, or how about when camping, where it seems like you are sweating enough to fill a pool and getting zero sleep. And that is something that shouldn’t happen to us ever again.

So keep it cool.

*Rule 5: Keep the AC between 62 and 68 degrees Fahrenheit.

See Also: The Best Way to End The Day: 5 Things to Do Before You Go to Sleep

Now that you know what keeps you awake at night, avoding these 5 mistakes should help you finally get some good sleep.