dirty hack for alloc factory