More refactoring, moved message logic outside the core module