refactoring, another example