generalized LF writer
fix general LF writer formats and remove dead code