Memory usage improvement