refactor model module