wrapper for the database