refactoring for example