refactoring adjacent to use set