Properly allocate memory once for very large values
Small refactoring
Making sure we won't leak memory
Midway through proper disposal of multiple allocations in transaction