refactor messaging module
use new messaging module format