DB refactoring done