cleaning up extract/out_mem API