This is somewhat confusing, I'd say move the second check to within the first.