A bit of refactoring...

pushing the messages in a method instead of inline