remove unneeded casts