eliminate unnecessary typecasts