Various performance improvements