duplication fix + refactoring