Restructure of code, more efficient memory usage.