multiline messages & some refactoring