remove extra array allocation, since we only use them once