refactoring to instances