diff --git a/src/common/database.rs b/src/common/database.rs
index ace94ec..fb413e2 100644
--- a/src/common/database.rs
+++ b/src/common/database.rs
@@ -49,30 +49,33 @@ impl<'r> FromRow<'r, SqliteRow> for ServerMembersWolves {
   fn from_row(row: &'r SqliteRow) -> Result<Self, Error> {
     let server_tmp: i64 = row.try_get("server")?;
     let server = GuildId::from(server_tmp as u64);
-    let discord = match row.try_get("discord") {
-      Ok(x) => {
-        let tmp: i64 = x;
-        if tmp == 0 {
-          None
-        } else {
-          Some(UserId::from(tmp as u64))
-        }
-      }
-      _ => None,
-    };
 
     Ok(Self {
       server,
       id_wolves: row.try_get("id_wolves")?,
       expiry: row.try_get("expiry")?,
       email: row.try_get("email")?,
-      discord,
+      discord: get_discord_from_row(row),
       minecraft: row.try_get("minecraft")?,
       minecraft_uid: row.try_get("minecraft_uid")?,
     })
   }
 }
 
+fn get_discord_from_row(row: &SqliteRow) -> Option<UserId> {
+  match row.try_get("discord") {
+    Ok(x) => {
+      let tmp: i64 = x;
+      if tmp == 0 {
+        None
+      } else {
+        Some(UserId::from(tmp as u64))
+      }
+    }
+    _ => None,
+  }
+}
+
 #[derive(Debug, Clone, Deserialize, Serialize)]
 pub struct Wolves {
   pub id_wolves: i64,
@@ -83,22 +86,10 @@ pub struct Wolves {
 
 impl<'r> FromRow<'r, SqliteRow> for Wolves {
   fn from_row(row: &'r SqliteRow) -> Result<Self, Error> {
-    let discord = match row.try_get("discord") {
-      Ok(x) => {
-        let tmp: i64 = x;
-        if tmp == 0 {
-          None
-        } else {
-          Some(UserId::from(tmp as u64))
-        }
-      }
-      _ => None,
-    };
-
     Ok(Self {
       id_wolves: row.try_get("id_wolves")?,
       email: row.try_get("email")?,
-      discord,
+      discord: get_discord_from_row(row),
       minecraft: row.try_get("minecraft")?,
     })
   }