improve write_child(), write_node()