Refactoring about the database model