Refactor on adjacent nodes