Move allocator code into the class.