All functions requiring a database now use the database