The following code sample (taken from AngularJS ui-router wiki) illustrates my problem.

```
angular.module('myApp', ['ui.router', 'ui.router.stateHelper'])
  .config(function(stateHelperProvider){
    stateHelperProvider.setNestedState({
      name: 'root',
      templateUrl: 'root.html',
      children: [
        {
          name: 'contacts',
          templateUrl: 'contacts.html',
          children: [
            {
              name: 'list',
              templateUrl: 'contacts.list.html'
            }
          ]
        },
        {
          name: 'products',
          templateUrl: 'products.html',
          children: [
            {
              name: 'list',
              templateUrl: 'products.list.html'
            }
          ]
        }
      ]
    });
  });

```

Specifically, these lines:

```
            }
          ]
        }
      ]
    });
  });

```

I find this very ugly. Is there a way to avoid these?

NOTE: I realize that CoffeeScript can help somewhat, but I am mainly interested in what can be done with Javascript.