Rework, remove writer class, cleanup