Modified the APIs signatures to remove void pointers and unnecessary unsafe castings.