Added two visitors, one for cast and one for instanceof