Security and performance improvements