Cast after we check for instanceof