Clean up code for nodes