refactor instance