diff --git a/src/utils/calculate.ts b/src/utils/calculate.ts
index 6b8c058..8badc58 100644
--- a/src/utils/calculate.ts
+++ b/src/utils/calculate.ts
@@ -49,7 +49,7 @@
     let permissions = [];
     let int = (BigInt("0x" + permissionsHex)).toString(2).split('').reverse();
     for (let index in int) {
-        if (int[index] == "1" && array.length > index) {
+        if (int[index] === "1" && array.length > index) {
             permissions.push(array[index]);
         }
     }
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 988fd37..dfdc3fb 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -148,7 +148,7 @@
                 });
                 let out;
                 try {
-                    out = await modalInteractionCollector(m, (m) => m.channel.id == this.interaction.channel.id, (m) => m.customId == "reason")
+                    out = await modalInteractionCollector(m, (m) => m.channel.id === this.interaction.channel.id, (m) => m.customId === "reason")
                 } catch (e) { return {} }
                 if (out.fields) { return { newReason: out.fields.getTextInputValue("reason") ?? "" }; }
                 else { return { newReason: this.reason } }
diff --git a/src/utils/createPageIndicator.ts b/src/utils/createPageIndicator.ts
index 8e18e30..fa203dc 100644
--- a/src/utils/createPageIndicator.ts
+++ b/src/utils/createPageIndicator.ts
@@ -3,13 +3,13 @@
 function pageIndicator(amount: number, selected: number, showDetails?: boolean | true) {
     let out = "";
 
-    if (amount == 1) {
-        out += getEmojiByName("TRACKS.SINGLE." + (selected == 0 ? "ACTIVE" : "INACTIVE"));
+    if (amount === 1) {
+        out += getEmojiByName("TRACKS.SINGLE." + (selected === 0 ? "ACTIVE" : "INACTIVE"));
     } else {
         for (let i = 0; i < amount; i++) {
             out += getEmojiByName("TRACKS.HORIZONTAL." +
-                (i == 0 ? "LEFT" : (i == amount - 1 ? "RIGHT" : "MIDDLE")) + "." +
-                (i == selected ? "ACTIVE" : "INACTIVE")
+                (i === 0 ? "LEFT" : (i === amount - 1 ? "RIGHT" : "MIDDLE")) + "." +
+                (i === selected ? "ACTIVE" : "INACTIVE")
             );
         }
     }
diff --git a/src/utils/database.ts b/src/utils/database.ts
index d24c7bf..2f04198 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -40,14 +40,16 @@
         return new Proxy(structuredClone(this.defaultData), Entry(entry)) as unknown as GuildConfig
     }
 
-    async write(guild: string, set: object = {}, unset: string[] = []) {
+    async write(guild: string, set: object | null, unset: string[] | string = []) {
         let uo = {}
+        if (!Array.isArray(unset)) unset = [unset]
         for (let key of unset) {
             uo[key] = null;
         }
-        let out = {}
+        let out = {$set: {}, $unset: {}}
         if (set) out["$set"] = set;
         if (unset.length) out["$unset"] = uo;
+        console.log(out)
         await this.guilds.updateOne({ id: guild }, out, { upsert: true });
     }
 
@@ -79,6 +81,10 @@
             }, { upsert: true });
         }
     }
+
+    async delete(guild: string) {
+        await this.guilds.deleteOne({ id: guild });
+    }
 }
 
 
@@ -116,6 +122,10 @@
         }).toArray()) as HistorySchema[];
         return entry;
     }
+
+    async delete(guild: string) {
+        await this.histories.deleteMany({ guild: guild });
+    }
 }
 
 export class ModNotes {
@@ -147,7 +157,7 @@
 
     async hasPremium(guild: string) {
         let entry = await this.premium.findOne({ appliesTo: { $in: [guild] } });
-        return entry != null;
+        return entry !== null;
     }
 }
 
diff --git a/src/utils/defaultEmbeds.ts b/src/utils/defaultEmbeds.ts
new file mode 100644
index 0000000..0f226da
--- /dev/null
+++ b/src/utils/defaultEmbeds.ts
@@ -0,0 +1,8 @@
+import EmojiEmbed from "./generateEmojiEmbed.js"
+
+export const LoadingEmbed = [new EmojiEmbed()
+    .setTitle("Loading")
+    .setDescription("One moment...")
+    .setStatus("Danger")
+    .setEmoji("NUCLEUS.LOADING")]
+
diff --git a/src/utils/log.ts b/src/utils/log.ts
index 987e256..22da837 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -11,7 +11,7 @@
 
 export class Logger {
     renderUser(user: Discord.User | string) {
-        if (typeof user == 'string') return `${user} [<@${user}>]`;
+        if (typeof user === 'string') return `${user} [<@${user}>]`;
         return `${user.username} [<@${user.id}>]`;
     }
     renderTime(t: number) {
@@ -55,7 +55,7 @@
     async log(log: any): Promise<void> {
         let config = await client.database.guilds.read(log.hidden.guild);
         if (!config.logging.logs.enabled) return;
-        if (!(log.meta.calculateType == true)) {
+        if (!(log.meta.calculateType === true)) {
             if(!toHexArray(config.logging.logs.toLog).includes(log.meta.calculateType)) return console.log('Not logging this type of event');
         }
         if (config.logging.logs.channel) {
@@ -84,20 +84,8 @@
                 channel.send({embeds: [embed]});
             }
         }
-        saveLog(log);
     }
 }
 
 
 export default {}
-
-async function saveLog(log: any): Promise<void> {
-}
-
-export function readLogs(guild: string) {
-    
-}
-
-export function readSpecificLog(guild: string, id: number) {
-    
-}
diff --git a/src/utils/singleNotify.ts b/src/utils/singleNotify.ts
index 051ec4d..f29d775 100644
--- a/src/utils/singleNotify.ts
+++ b/src/utils/singleNotify.ts
@@ -7,11 +7,13 @@
     "Info": "Success"
 }
 
-export default async function(type: string, guild: string, message: string, severity: string) {
+export default async function(type: string, guild: string, message: string | true, severity?: string) {
     let data = await client.database.guilds.read(guild);
+    if (message === true) {
+        return await client.database.guilds.write(guild, {[`singleEventNotifications.${type}`]: false});
+    }
     if (data.singleEventNotifications[type]) return;
-    data.singleEventNotifications[type] = true;
-    client.database.guilds.write(guild, data);
+    await client.database.guilds.write(guild, {[`singleEventNotifications.${type}`]: true});
     try {
         let channel = await client.channels.fetch(data.logging.staff.channel);
         if (!channel) return;
