if- and else-blocks of this statement may be pulled out as separate methods (if incompleteMessages == null / else)