Refactored ElementAllocator.prototype.allocate to save a line