Refactor: log messages.