avoid duplicate checkcasts