Initial idea would be to modify the current algorithm to make use of masked arrays and only compute clean where the mask is `False`.