Move renderTSObject() method to the controller.