add new message types
some refactoring