improve comparisons and checks