remove unnecessary typecasts