Improve memory usage