Moves database access functions to the Database Model