             data =
                 has_tables: namespaces_in_db.length > 0
                 tables: _.sortBy(namespaces_in_db, (namespace) -> namespace.name)
-
+            
+            # Render only if something has changed. @render is executed everytime someone change the shards on a table (even if not in the database)
             if not @data isnt data
                 @data = data
                 @.$el.html @template @data
             return @
 
+        # Unbind listeners
         destroy: =>
             namespaces.off 'change:shards', @render
             namespaces.off 'change:primary_pinnings', @render

                error: @on_error

        on_success: (response) =>
            window.router.navigate '#tables'
            window.app.index_namespaces
                alert_message: "The database #{@database_to_delete.get('name')} was successfully deleted."

            namespace_id_to_remove = []
            for namespace in namespaces.models
                if namespace.get('database') is @database_to_delete.get('id')

                        data.num_live_namespaces++
                    data.nshards += namespace_status.nshards
                    data.nreplicas += data.nshards + namespace_status.nreplicas

                    for datacenter_id of namespace.get('replica_affinities')
                        # We don't count universe, and we add the datacenter only if it has at least one replica
                        if datacenter_id isnt universe_datacenter.get('id') and (namespace.get('replica_affinities')[datacenter_id] > 0 or namespace.get('primary_uuid') is datacenter_id)
                            datacenters_working[datacenter_id] = true

