Remove unnecessary typecasts