restructured UAIFileGenerator, final version