removing unnecessary castings