Remove redundant code
Eliminate casts