Memory and performance improvements