Refactor equals nodes operations