Frasier says : "The fact is that dreams are a bi-product of unresolved emotion."
I am sorry but that's not entirely true, why else would you have nightmares caused by indigestion? Not to mention all the dreams related to your environment, like when your legs are caught in the sheets and you dream that you are trying to run but can't...