Refactoring of models