Our Brain Is Busy When We Sleep!!!

When we sleep, our brain is busy organizing information and sensory input.
Why is it that our brain organizes the information when we are sleeping?
Because when we sleep, we do not have to deal with the outside world. Our brain does not have the external sensory input that it has while we are awake. Even though our subconscious mind is still awake, and we take input from senses, like hearing, smelling and feeling things, that input is minimum when compared to what we get when we are awake.
When we sleep, we usually have our eyes closed, so we do not take any external visual information. All the images in our dreams come from within our brain.
However, we do hear our surroundings. For instance, if there is a dog barking, we take that input and may integrate it to our dreams, so we might continue the scene of our dream with a dog in it. If there is a storm outside and we can hear the sound of wind, rain and thunder, we might have a storm in our dream.
We also take other sensory input while we sleep, for example, if we are cold, we might experience dreaming that we are out in the cold weather without a sweater.
When we dream, all the visual elements come from what we have seen before while awake, as come most of the other sensory elements. All these elements are being processed, associated, reorganized and consolidated in our memory, keeping the important information and discarding what is not relevant.