Break out autoAllocate to its own function