Removing unnecessary void* cast