generator: code cleanup