unnecessary typecasts removed