Updated CodeGenerator code after review.