Improving refine performance by reducing memory consumption.