Internal refactor to nodes