memory usage improvement