i had the same problem recently and somebody told to take magnesium. i take 400mg of magnesium in the day and i sleep pretty good. i wake up but i'm able to go right back to sleep.
i had the exact problem you had. something would wake me up and i'd be up for hours and my mind wouldn't shut up.
laying off the caffeine should help too. or just drink it in the morning.