Using indent method to refactor controller generator.

Small refactor that uses the previously defined `indent` method for making indentations in the controller generator. 

\cc @spastorino