Simplify ifs