Improve memory usage slightly