diff --git a/rel.module b/rel.module
index 30fb5c9..b51a0b1 100644
--- a/rel.module
+++ b/rel.module
@@ -353,7 +353,7 @@ function rel_form_alter(&$form, &$form_state, $form_id) {
     $form['#attached']['css'][] = drupal_get_path('module', 'rel') . '/rel.admin.css';
 
     // (Un)Register link.
-    drupal_add_js('misc/ajax.js');
+    drupal_add_library('system', 'drupal.ajax');
     $link = l($link_text, $callback . '/' . $form_id, array('attributes' => array('class' => array('ctools-use-modal')), 'query' => drupal_get_destination()));
     $form['rel_register_link'] = array(
       '#type' => 'markup',
@@ -434,8 +434,7 @@ function rel_form_field_ui_field_overview_form_alter(&$form, &$form_state) {
         '#suffix' => '</div>',
         '#tree' => TRUE,
       );
-      $form['#attached']['js'][] = 'misc/form.js';
-      $form['#attached']['js'][] = 'misc/collapse.js';
+      $form['#attached']['library'][] = array('system', 'drupal.collapse');
     }
 
     // Add layouts form.
