 
     self.applyFormatters(logDetails: &logDetails, message: &message)
     //store log detail
-    let logsRef = firebaseRef.child("Logs")
-    if aesEncoder != nil {
-      let encryptedDaga = encryptLogData(logDetails: logDetails)
-      logsRef.child(message.md5()).setValue(encryptedDaga)
-    } else {
-      logsRef.child(message.md5()).setValue(logDetails.json)
-    }
-  }
-
-  private func encryptLogData(logDetails: LogDetails) -> String {
-    let data = try! JSONSerialization.data(withJSONObject: logDetails.json, options: JSONSerialization.WritingOptions(rawValue: 0))
-    let raw = try! aesEncoder!.encrypt(data)
-    let encryptedData = Data(bytes: raw)
-    return encryptedData.toHexString()
+    saveStrategy.save(logDetails: logDetails, message: message)
   }
 }

  }
}

public class FirebaseDestination: BaseDestination {

  public struct EncryptionParams {
    let key: String
    let iv: String

      self.iv = iv
    }
  }
  private let saveStrategy: SaveStrategy
  /**
   Designated initialization

