Database tests. Refactor Database.