diff --git a/views_autorefresh/views_autorefresh.info b/views_autorefresh/views_autorefresh.info
index d347534..435f241 100644
--- a/views_autorefresh/views_autorefresh.info
+++ b/views_autorefresh/views_autorefresh.info
@@ -6,4 +6,4 @@ core = 7.x
 
 files[] = views_autorefresh_handler_argument_base.inc
 files[] = views_autorefresh_handler_argument_date.inc
-
+files[] = views_autorefresh_handler_area_refreshcode.inc
diff --git a/views_autorefresh/views_autorefresh.views.inc b/views_autorefresh/views_autorefresh.views.inc
index 0fd14d9..2bd86c5 100644
--- a/views_autorefresh/views_autorefresh.views.inc
+++ b/views_autorefresh/views_autorefresh.views.inc
@@ -4,6 +4,15 @@
  * Implementation of hook_views_data_alter().
  */
 function views_autorefresh_views_data_alter(&$data) {
+  // Add our autorefresh area to Global.
+  $data['views']['autorefresh'] = array(
+    'title' => t('Autorefresh config'),
+    'help' => t('Enable autorefresh for this view.'),
+    'area' => array(
+      'handler' => 'views_autorefresh_handler_area_refreshcode',
+    ),
+  );
+
   foreach ($data as $table_name => $table_info) {
     foreach ($table_info as $field_name => $field_info) {
       // Add an operator-based date handler to all date arguments.
@@ -33,22 +42,3 @@ function views_autorefresh_views_data_alter(&$data) {
   }
 }
 
-/**
- * Implementation of hook_views_handlers().
- */
-function views_autorefresh_views_handlers() {
-  return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views_autorefresh'),
-    ),
-    'handlers' => array(
-      'views_autorefresh_handler_argument_date' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_autorefresh_handler_argument_base' => array(
-        'parent' => 'views_handler_argument',
-      ),
-    ),
-  );
-}
-
diff --git a/views_autorefresh/views_autorefresh_handler_area_refreshcode.inc b/views_autorefresh/views_autorefresh_handler_area_refreshcode.inc
new file mode 100644
index 0000000..6dccbcb
--- /dev/null
+++ b/views_autorefresh/views_autorefresh_handler_area_refreshcode.inc
@@ -0,0 +1,121 @@
+<?php
+
+/**
+ * Base class for area handlers.
+ *
+ * @ingroup views_area_handlers
+ */
+class views_autorefresh_handler_area_refreshcode extends views_handler_area {
+
+  /**
+   * Overrides views_handler_area::init().
+   *
+   * Reset override done in views_handler_area::init(). This area must be
+   * rendered even if view has no results.
+   */
+  function init(&$view, &$options) {
+    parent::init($view, $options);
+  }
+
+  function option_definition() {
+    $options = array();
+    $options['interval'] = array('default' => '');
+    $options['incremental'] = array('default' => FALSE, 'bool' => TRUE);
+    $options['display'] = array('default' => '');
+    $options['ping'] = array('default' => FALSE, 'bool' => TRUE);
+    $options['ping_base_path'] = array('default' => '');
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['interval'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Interval to check for new items'),
+      '#default_value' => $this->options['interval'],
+      '#description' => t('This data is interpreted as milliseconds.'),
+      '#required' => TRUE,
+    );
+    $form['incremental'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use a secondary view display to incrementally insert new items only'),
+      '#default_value' => $this->options['incremental'],
+    );
+
+    $options = array();
+    foreach ($this->view->display as $display) {
+      if (($display->display_plugin == 'page') && ($display->id != $form_state['display_id'])) {
+        # TODO: check display arguments.
+        $options[$display->id] = $display->display_title;
+      }
+    }
+    $form['display'] = array(
+      '#type' => 'select',
+      '#title' => 'Choose the display',
+      '#default_value' => $this->options['display'],
+      '#description' => t('Only displays of type page are eligible. Additionally the display must have a timestamp argument of the <em>(with operator)</em> variant. For example <em>Node: Post date (with operator)</em>.'),
+      '#options' => $options,
+      '#dependency' => array(
+        'edit-options-incremental' => array(1),
+      ),
+    );
+    $form['ping'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use a ping url'),
+      '#default_value' => $this->options['ping'],
+      '#description' => t('Use a custom script for faster check of new items.'),
+    );
+    global $base_url;
+    # TODO: offer to choose path to a module to better work out of the box with drupal_get_path() ?
+    $form['ping_base_path'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Path to the ping script'),
+      '#default_value' => $this->options['ping_base_path'],
+      '#description' => t('This url is relative to the Drupal root.'),
+      '#dependency' => array(
+        'edit-options-ping' => array(1),
+      ),
+    );
+  }
+
+  function options_validate(&$form, &$form_state) {
+    if (!is_numeric($form_state['values']['options']['interval'])) {
+      form_set_error('interval', t('Invalid interval.'));
+    }
+    # TODO: check the ping script actualy returns the json we are expecting?
+    if ($form_state['values']['options']['ping']) {
+      $ping_base_path = $form_state['values']['options']['ping_base_path'];
+      if (!file_exists(DRUPAL_ROOT . '/' . $ping_base_path)) {
+        form_set_error('ping_base_path', t('Ping script not found.'));
+      }
+    }
+  }
+
+  function render($empty = FALSE) {
+    $args = array();
+    $args['view'] = $this->view;
+    $args['interval'] = $this->options['interval'];
+    if  ($this->options['ping']) {
+      $args['ping'] = array(
+        'ping_base_path' => $this->options['ping_base_path'],
+      );
+    }
+    if  ($this->options['incremental']) {
+      $display = $this->view->display[$this->options['display']];
+
+      $args['incremental'] = array(
+        'view_base_path' => $display->display_options['path'],
+        'view_display_id' => $display->id,
+        'view_name' => $this->view->name,
+        'sourceSelector' => '.view-content',
+        'targetSelector' => '.view-content',
+        'firstClass' => 'views-row-first',
+        'lastClass' => 'views-row-last',
+        'oddClass' => 'views-row-odd',
+        'evenClass' => 'views-row-even',
+      );
+    }
+
+    return theme('views_autorefresh', $args);
+  }
+}
+
