Refactored nodeset into its own class.