Code refactoring on Model