DB refactoring