Move writeNode to data module.