Simplify a couple if expressions slightly