various performance improvements