Improving in-memory usage