remove more unnecessary casts