eliminate redundant compares, make terser