Refactoring Database