introduce struct writer and struct writer_node