_on_raw_message cleanup

Readjusted the organization of the method.