removing spurious ifs