trying to fix a memory leak by eliminating void pointers, this is not a stable commit