Optimize the memory class