Coffee also affects my sleep but I need it to fight off my depression to some extent. So I have found one cup (250ml) early in the morning doesn't affect my sleep.
I have also found, I can have one more cup on the days I go running! (Physical exercise has something to do with caffeine efect on body)
I have a personal rule of no caffeine after 4PM. It helps with sleep! (6 hours before sleep is the idea)
I wasn't aware of these things until few years ago but now I do and I hope this helps someone!
And they can have my coffee when they pry it from my cold dead hands.
"Rats fed dimethylurea and 0.3% sodium nitrite for 36 days developed tumours of CNS, heart, thymus, kidney or thyroid in all animals (Sander, 1970)." http://www.inchem.org/documents/jecfa/jecmono/v05je15.htm