new ins encrypt and some optimize