Update code to Moodle standards