duplication refactoring