Refactoring to make node-ready.