refactoring example