new more modular genarator/parser code