Small refactoring for future db storage of messages