refactoring sample