Simplify the logic a bit.