unnecessary casts removed