Simplify code flow (I think it's preferable to check == rather than != when both conditions are evaluated)