Update to improve memory usage