Refactor to create node inside rb class