Database refactoring 6