Removed the nesting logic out of the view and into the controller.
Removed the nesting logic out of the html and into the controller.