Abstracted the database and connection layers