merging from SVN - new AST-based Factory