instances refactor