Yes, I do agree that it’s important not to appear very negative in your letter. If you’ve got on well with your boss and co-workers, you probably don’t want to offend anybody in your letter. As already mentioned, better to leave the reason out if it’s going to sound terrible.
It can be quite tricky to write a letter of this nature. I’d suggest taking your time and not rushing it, as it could go horribly wrong. Also, make sure you’re not angry and frustrated and putting all your anger in a letter.