Combine nested ifs.