Fully replace CheckExists with much more expressive 'Case' statement.