free instance refactoring