diff --git a/amp.module b/amp.module
index 513e1e6..0adf387 100644
--- a/amp.module
+++ b/amp.module
@@ -42,6 +42,12 @@ function amp_menu() {
  */
 function amp_theme() {
   $theme =  array(
+    'amp_ad' => array(
+      'variables' => array(
+        'attributes' => array()
+      ),
+      'template' => 'amp-ad'
+    ),
     'amp_analytics' => array(
       'variables' => array(
         'account' => NULL,
@@ -566,14 +572,15 @@ function amp_block_view($delta = '') {
       $height = variable_get('amp_google_adsense_block_height', '');
       $data_ad_slot = variable_get('amp_google_adsense_block_data_ad_slot', '');
       if (!empty($width) && !empty($height) && !empty($data_ad_slot)) {
+        $block['subject'] = NULL;
         $block['content'] = array(
-          'message' => array(
-            '#type' => 'markup',
-            '#markup' => t('Height: @height, width: @width, ad slot: @adslot', array(
-              '@height'  => $height,
-              '@width'  => $width,
-              '@adslot'  => $data_ad_slot,
-            )),
+          '#theme' => 'amp-ad',
+          '#attributes' => array(
+            'type' => 'adsense',
+            'height'  => $height,
+            'width'  => $width,
+            'data-ad-client'  => $adsense_id,
+            'data-ad-slot'  => $data_ad_slot,
           ),
         );
       }
@@ -595,14 +602,14 @@ function amp_block_view($delta = '') {
       $height = variable_get('amp_google_doubleclick_block_height', '');
       $data_ad_slot = variable_get('amp_google_doubleclick_block_data_ad_slot', '');
       if (!empty($width) && !empty($height) && !empty($data_ad_slot)) {
+        $block['subject'] = NULL;
         $block['content'] = array(
-          'message' => array(
-            '#type' => 'markup',
-            '#markup' => t('Height: @height, width: @width, ad slot: @adslot', array(
-              '@height'  => $height,
-              '@width'  => $width,
-              '@adslot'  => $data_ad_slot,
-            )),
+          '#theme' => 'amp-ad',
+          '#attributes' => array(
+            'type' => 'doubleclick',
+            'height'  => $height,
+            'width'  => $width,
+            'data-slot'  => $doubleclick_id . '/' . $data_ad_slot,
           ),
         );
       }
