Major performance and security improvements