cleaned up a lot of unneeded casts