tests refactored with db updating