Small refactoring changes to generators.

Made a method name clearer (added a bang to the end to show that it mutates arguments) and extracted indentation into its own method.

\cc @spastorino