simplify cell encrypting code