delete extra ifs