Review comment: final.
Review comment: extract helper methods in generator.
More testing.