Design improvements and security fix