refactor messages to be a little more robust