Improvements on generator