The general rule in Cesium is that if you use a property more than once, you should extract it out into a local.  So declare `var container = viewModel._container` and replace your usage of it throughout this function.  It will make the code easier to read and also improves performance.