Do some of the conversion away from instance-of tests.