diff --git a/src/guards/auth.rs b/src/guards/auth.rs
index b2842b48a2babcf94252aa93abec9f691a7ebd43..c9b297455e608509c3b6e8fbdf0cc712ad586a18 100644
--- a/src/guards/auth.rs
+++ b/src/guards/auth.rs
@@ -133,7 +133,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for User {
             0 => Outcome::Failure((Status::Forbidden, AuthError::Missing)),
             1 => {
                 let key = keys[0];
-                let col = database::get_db().collection("users");
+                let col = database::get_collection("users");
                 let result = col.find_one(doc! { "access_token": key }, None).unwrap();
 
                 if let Some(user) = result {
@@ -165,7 +165,7 @@ impl<'r> FromParam<'r> for User {
     type Error = &'r RawStr;
 
     fn from_param(param: &'r RawStr) -> Result<Self, Self::Error> {
-        let col = database::get_db().collection("users");
+        let col = database::get_collection("users");
         let result = col
             .find_one(doc! { "_id": param.to_string() }, None)
             .unwrap();
diff --git a/src/guards/channel.rs b/src/guards/channel.rs
index 756f8f36e198f7384b83826bd905180ac74a32b2..10f411611aa0a8df5a1d7a51164ec1d022346581 100644
--- a/src/guards/channel.rs
+++ b/src/guards/channel.rs
@@ -13,7 +13,7 @@ impl<'r> FromParam<'r> for Channel {
     type Error = &'r RawStr;
 
     fn from_param(param: &'r RawStr) -> Result<Self, Self::Error> {
-        let col = database::get_db().collection("channels");
+        let col = database::get_collection("channels");
         let result = col
             .find_one(doc! { "_id": param.to_string() }, None)
             .unwrap();
@@ -82,7 +82,7 @@ impl<'r> FromParam<'r> for Message {
     type Error = &'r RawStr;
 
     fn from_param(param: &'r RawStr) -> Result<Self, Self::Error> {
-        let col = database::get_db().collection("messages");
+        let col = database::get_collection("messages");
         let result = col
             .find_one(doc! { "_id": param.to_string() }, None)
             .unwrap();
diff --git a/src/guards/guild.rs b/src/guards/guild.rs
index 6e2aeb6069f0eac5a8f5c334d50656d5d2a28b3e..aa57c55958872b2c0d800471ba9911a4e2beb4a5 100644
--- a/src/guards/guild.rs
+++ b/src/guards/guild.rs
@@ -79,7 +79,7 @@ impl<'r> FromParam<'r> for Guild {
     type Error = &'r RawStr;
 
     fn from_param(param: &'r RawStr) -> Result<Self, Self::Error> {
-        let col = database::get_db().collection("guilds");
+        let col = database::get_collection("guilds");
         let result = col
             .find_one(doc! { "_id": param.to_string() }, None)
             .unwrap();
diff --git a/src/routes/channel.rs b/src/routes/channel.rs
index a9fedb633258ea6b1e1826889bfd594a6eee0628..0b6b3d1696e3edf3d7b8502ad670df6cb0c38806 100644
--- a/src/routes/channel.rs
+++ b/src/routes/channel.rs
@@ -129,7 +129,7 @@ pub fn channel(user: UserRef, target: ChannelRef) -> Option<Response> {
             } else {
                 None
             }
-        },
+        }
         2 => {
             if let Some(info) = target.fetch_data(doc! {
                 "name": 1,
@@ -167,20 +167,21 @@ pub fn delete(user: UserRef, target: ChannelRef) -> Option<Response> {
     let try_delete = || {
         let messages = database::get_collection("messages");
 
-        if messages.delete_many(
-            doc! { "channel": &target_id },
-            None
-        ).is_ok() {
-            if col.delete_one(
-                doc! { "_id": &target_id },
-                None
-            ).is_ok() {
+        if messages
+            .delete_many(doc! { "channel": &target_id }, None)
+            .is_ok()
+        {
+            if col.delete_one(doc! { "_id": &target_id }, None).is_ok() {
                 Some(Response::Result(super::Status::Ok))
             } else {
-                Some(Response::InternalServerError(json!({ "error": "Failed to delete group." })))
+                Some(Response::InternalServerError(
+                    json!({ "error": "Failed to delete group." }),
+                ))
             }
         } else {
-            Some(Response::InternalServerError(json!({ "error": "Failed to delete messages." })))
+            Some(Response::InternalServerError(
+                json!({ "error": "Failed to delete messages." }),
+            ))
         }
     };
 
@@ -216,27 +217,30 @@ pub fn delete(user: UserRef, target: ChannelRef) -> Option<Response> {
                     &owner
                 };
 
-                if col.update_one(
-                    doc! { "_id": target_id },
-                    doc! {
-                        "$set": {
-                            "owner": new_owner,
+                if col
+                    .update_one(
+                        doc! { "_id": target_id },
+                        doc! {
+                            "$set": {
+                                "owner": new_owner,
+                            },
+                            "$pull": {
+                                "recipients": &user.id,
+                            }
                         },
-                        "$pull": {
-                            "recipients": &user.id,
-                        }
-                    },
-                    None
-                ).is_ok() {
+                        None,
+                    )
+                    .is_ok()
+                {
                     Some(Response::Result(super::Status::Ok))
                 } else {
-                    Some(Response::InternalServerError(json!({ "error": "Failed to remove you from the group." })))
+                    Some(Response::InternalServerError(
+                        json!({ "error": "Failed to remove you from the group." }),
+                    ))
                 }
             }
         }
-        2 => {
-            try_delete()
-        }
+        2 => try_delete(),
         _ => Some(Response::InternalServerError(
             json!({ "error": "Unknown error has occurred." }),
         )),
diff --git a/src/routes/user.rs b/src/routes/user.rs
index 0126424eaf53b77263aa69fa9462637ae556fe32..004a977d431e36a297e4025087720bc7bb20c9c1 100644
--- a/src/routes/user.rs
+++ b/src/routes/user.rs
@@ -1,10 +1,9 @@
 use super::Response;
-use crate::database::{self, channel::Channel};
-use crate::database::{get_relationship, get_relationship_internal, Relationship};
+use crate::database::{self, get_relationship, get_relationship_internal, Relationship};
 use crate::guards::auth::UserRef;
 use crate::routes::channel;
 
-use bson::{doc, from_bson};
+use bson::doc;
 use mongodb::options::FindOptions;
 use rocket_contrib::json::Json;
 use serde::{Deserialize, Serialize};
@@ -92,11 +91,7 @@ pub fn dms(user: UserRef) -> Response {
                 ],
                 "recipients": user.id
             },
-            FindOptions::builder()
-                .projection(doc! {
-
-                })
-                .build(),
+            FindOptions::builder().projection(doc! {}).build(),
         )
         .expect("Failed channel lookup");
 
@@ -113,7 +108,7 @@ pub fn dms(user: UserRef) -> Response {
                         "type": 0,
                         "recipients": recipients,
                     }));
-                },
+                }
                 1 => {
                     channels.push(json!({
                         "id": id,
@@ -123,8 +118,8 @@ pub fn dms(user: UserRef) -> Response {
                         "owner": doc.get_str("owner").unwrap(),
                         "description": doc.get_str("description").unwrap_or(""),
                     }));
-                },
-                _ => unreachable!()
+                }
+                _ => unreachable!(),
             }
         }
     }