working on message processing logic