refactoring sample3