Split creation of AST and remove old stream writer