Remove redundant comparisons, reformat