Tweak to message logic and some cleanup