attempt memory usage optimization