Many memory use improvements