Speed optimization and security improvements