Improve source file generator