Refactor Database Model