diff --git a/src/utils/database.ts b/src/utils/database.ts
index 4e37652..66d7e67 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -1,5 +1,12 @@
-import { Collection, Db, MongoClient } from 'mongodb';
+import Discord from 'discord.js';
+import { Collection, MongoClient } from 'mongodb';
 import structuredClone from '@ungap/structured-clone';
+import config from '../config/main.json' assert {type: 'json'};
+
+
+const mongoClient = new MongoClient(config.mongoUrl);
+await mongoClient.connect()
+const database = mongoClient.db("Nucleus");
 
 
 export const Entry = data => {
@@ -19,21 +26,11 @@
 }
 
 
-export default class Database {
-    mongoClient: MongoClient;
-    database: Db;
+export class Guilds {
     guilds: Collection<GuildConfig>;
     defaultData: GuildConfig;
-
-    constructor(url) {
-        this.mongoClient = new MongoClient(url);
-    }
-
-    async connect() {
-        await this.mongoClient.connect()
-        this.database = this.mongoClient.db("Nucleus");
-        this.guilds = this.database.collection<GuildConfig>("guilds");
-        await this.guilds.createIndex({ id: "text" }, { unique: true });
+    async setup() {
+        this.guilds = database.collection<GuildConfig>("guilds");
         this.defaultData = (await import("../config/default.json", { assert: { type: "json" }})).default as unknown as GuildConfig;
         return this;
     }
@@ -79,6 +76,85 @@
     }
 }
 
+
+export class History {
+    histories: Collection<HistorySchema>;
+    defaultData: GuildConfig;
+
+    async setup() {
+        this.histories = database.collection<HistorySchema>("history");
+        return this;
+    }
+
+    async create(type: string, guild: string, user: Discord.User, moderator: Discord.User | null, reason: string | null, before?: null, after?: null, amount?: null) {
+        await this.histories.insertOne({
+            type: type,
+            guild: guild,
+            user: user.id,
+            moderator: moderator.id,
+            reason: reason,
+            occurredAt: new Date(),
+            before: before,
+            after: after,
+            amount: amount
+        });
+    }
+
+    async read(guild: string, user: string, year: number) {
+        let entry = (await this.histories.find({
+            guild: guild,
+            user: user,
+            occurredAt: {
+                $gte: new Date(year - 1, 11, 31, 23, 59, 59),
+                $lt: new Date(year + 1, 0, 1, 0, 0, 0)
+            }
+        }).toArray()) as HistorySchema[];
+        return entry;
+    }
+}
+
+export class ModNotes {
+    modNotes: Collection<ModNoteSchema>;
+    defaultData: GuildConfig;
+
+    async setup() {
+        this.modNotes = database.collection<ModNoteSchema>("modNotes");
+        return this;
+    }
+
+    async create(guild: string, user: string, note: string | null) {
+        await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note }}, { upsert: true });
+    }
+
+    async read(guild: string, user: string) {
+        let entry = await this.modNotes.findOne({ guild: guild, user: user });
+        return entry?.note ?? null;
+    }
+}
+
+export class EventSchedulerDatabase {
+    events: Collection<EventSchedulerSchema>;
+    defaultData: GuildConfig;
+
+    async setup() {
+        this.events = database.collection<EventSchedulerSchema>("eventScheduler");
+        return this;
+    }
+
+    async create(timestamp: Date, data: object) {
+        await this.events.insertOne({ timestamp: timestamp, data: data});
+    }
+
+    async getNext() {
+        let entry = await this.events.findOne({ timestamp: { $lte: new Date() }});
+        return entry;
+    }
+
+    async remove(timestamp: Date, data: object) {
+        await this.events.deleteOne({ timestamp: timestamp, data: data});
+    }
+}
+
 export interface GuildConfig {
     id: string,
     version: number,
@@ -205,10 +281,33 @@
             max: number,
             options: {
                 name: string,
-                description: string,
+                description: string | null,
                 role: string
             }[]
         }[]
     }
     tags: {}
-};
\ No newline at end of file
+};
+
+export interface HistorySchema {
+    type: string,
+    guild: string,
+    user: string,
+    moderator: string | null,
+    reason: string,
+    occurredAt: Date,
+    before: string | null,
+    after: string | null,
+    amount: string | null
+}
+
+export interface ModNoteSchema {
+    guild: string,
+    user: string,
+    note: string
+}
+
+export interface EventSchedulerSchema {
+    timestamp: Date,
+    data: object
+}
\ No newline at end of file
