split messages and fix whitespace