diff --git a/comment/locallib.php b/comment/locallib.php
index fd62b61..f7ce560 100644
--- a/comment/locallib.php
+++ b/comment/locallib.php
@@ -80,27 +80,6 @@ class comment_manager {
     }
 
     /**
-     * Records the course object
-     *
-     * @global moodle_page $PAGE
-     * @global moodle_database $DB
-     * @param int $courseid
-     * @return void
-     */
-    private function setup_course($courseid) {
-        global $PAGE, $DB;
-        if (!empty($this->course)) {
-            // already set, stop
-            return;
-        }
-        if ($courseid == $PAGE->course->id) {
-            $this->course = $PAGE->course;
-        } else if (!$this->course = $DB->get_record('course', array('id' => $courseid))) {
-            $this->course = null;
-        }
-    }
-
-    /**
      * Sets up the module or block information for a comment
      *
      * @global moodle_database $DB
@@ -125,9 +104,7 @@ class comment_manager {
             case CONTEXT_MODULE:
                 $this->plugintype = 'mod';
                 $this->cm = get_coursemodule_from_id('', $this->context->instanceid);
-                $this->setup_course($this->cm->course);
-                $this->modinfo = get_fast_modinfo($this->course);
-                $this->pluginname = $this->modinfo->cms[$this->cm->id]->modname;
+                $this->pluginname = $this->cm->modname;
                 break;
         }
         return true;
