Slight refactoring of the Database class