move `self._make_message(record)` out of condition to remove duplication