updating and improving CryptoManager