remove unnecessary casts