removed unnecessary casts (legacy)