Refactor, dont use primitive to compare nodes