refactor instance model