refactored proces_text_message method