refactoring sample1