Replace crypt_type enum with class object