second refactoring