removed a few unnecessary casts