refactoring uniqueness rule scope