Generate TeX
reorganize parts to modules.
separate transformation logic.