refactoring and cleaning files regarding Duplicate