refactor messaging mechanizm