removed some unnecessary casts