Refactored allocator.
Added node allocator.