Refactored CreateNode