refactor SourceCodeGen