refactoring message publish architect + add session token and master token feature