avoid double check-casts