diff --git a/gigya.install b/gigya.install
index bc3bc48..8e4135c 100644
--- a/gigya.install
+++ b/gigya.install
@@ -29,17 +29,23 @@ function gigya_uninstall() {
   $secret = variable_get('gigya_SecretKey', '');
 
   // Delete variables.
-  // TODO Please convert this statement to the D7 database API syntax.
-  $variables = db_query("SELECT name FROM {variable} WHERE name LIKE 'gigya%%'");
-  while ($variable = db_fetch_object($variables)) {
-    variable_del($variable->name);
+  $variables = db_select('variable', 'v')
+    ->fields('v', array('name'))
+    ->condition('name', 'gigya%%', 'LIKE')
+    ->execute()
+    ->fetchCol();
+  foreach ($variables as $var) {
+    variable_del($var);
   }
 
   // Delete actions.
-  // TODO Please convert this statement to the D7 database API syntax.
-  $actions = db_query("SELECT aid FROM {actions} WHERE callback LIKE 'gigya%%'");
-  while ($action = db_fetch_array($actions)) {
-    actions_delete($action['aid']);
+  $actions = db_select('actions', 'a')
+    ->fields('a', array('aid'))
+    ->condition('callback', 'gigya%%', 'LIKE')
+    ->execute()
+    ->fetchCol();
+  foreach ($actions as $action) {
+    actions_delete($action);
   }
 }
 
