refactoring of models