some refactor in Model