Updating how messages are reset.
Cleaning up message handling functions.