diff --git a/gmap.info b/gmap.info
index 37b74d8..0877289 100644
--- a/gmap.info
+++ b/gmap.info
@@ -8,3 +8,4 @@ files[] = gmap_plugin_style_gmap.inc
 files[] = gmap_plugin_style_gmapextended.inc
 files[] = tests/gmap.test
 files[] = lib/Drupal/gmap/GmapDefaults.php
+files[] = lib/Drupal/gmap/GmapBehaviours.php
diff --git a/gmap.module b/gmap.module
index 6020e4a..db65f4f 100755
--- a/gmap.module
+++ b/gmap.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\gmap\GmapDefaults;
+use Drupal\gmap\GmapBehaviours;
 
 /**
  * Define the Google Maps API version being used.
@@ -52,20 +53,11 @@ function gmap_theme() {
  * Invokes hook_gmap() in every module.
  *
  * We can't use module_invoke_all() because we pass $map by reference.
+ * @deprecated use GmapBehaviours::getInstance()->getBehaviours($op, $map);
  */
-function gmap_module_invoke($op, &$map) {
-  $return = array();
-  foreach (module_implements('gmap') as $module) {
-    $function = $module . '_gmap';
-    $result = $function($op, $map);
-    if (isset($result) && is_array($result)) {
-      $return = array_merge_recursive($return, $result);
-    }
-    elseif (isset($result)) {
-      $return[] = $result;
-    }
-  }
-  return $return;
+function gmap_module_invoke($op, $map) {
+  include_once(drupal_get_path('module', 'gmap') . '/lib/Drupal/gmap/GmapBehaviours.php');
+  return GmapBehaviours::getInstance()->getBehaviours($op, $map);
 }
 
 /**
diff --git a/lib/Drupal/gmap/GmapBehaviours.php b/lib/Drupal/gmap/GmapBehaviours.php
new file mode 100644
index 0000000..a182a8c
--- /dev/null
+++ b/lib/Drupal/gmap/GmapBehaviours.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: podarokua
+ * Date: 29.11.13
+ * Time: 19:33
+ */
+
+namespace Drupal\gmap;
+
+
+class GmapBehaviours {
+
+  private $behaviours;
+
+  static private $gmapBehaviours;
+
+  private function __construct() {
+  }
+
+  /**
+   * do not clone
+   */
+  protected function __clone() {
+  }
+
+  /**
+   * @return GmapBehaviours SingleTon instance
+   */
+  static public function getInstance() {
+    if (is_null(self::$gmapBehaviours)) {
+      self::$gmapBehaviours = new self();
+    }
+    return self::$gmapBehaviours;
+  }
+
+  public function getBehaviours($op, $map) {
+    unset($this->behaviours);
+    $this->behaviours = array();
+      foreach (module_implements('gmap') as $module) {
+        $function = $module . '_gmap';
+        $result = $function($op, $map);
+        if (isset($result) && is_array($result)) {
+          $this->behaviours = array_merge_recursive($this->behaviours, $result);
+        }
+        elseif (isset($result)) {
+          $this->behaviours[] = $result;
+        }
+      }
+    return $this->behaviours;
+  }
+} 
\ No newline at end of file
