code cleanup;
added support for message retry;