redesigned writer and parser