Simplify a couple of Ifs