simplify extref memory allocation and processing