memory and performance improvements