public function removeListener($eventName, $listener)
    {
        if (!isset($this->listeners[$eventName])) {
            return false;
        }

        // removing listeners for a given event
        foreach ($this->listeners[$eventName] as $i => $callback) {
            if ($listener === $callback) {
                unset($this->listeners[$eventName][$i]);
            }
        }

        // cleaning listener container if there is not more listeners on it
        if (count($this->listeners[$eventName]) == 0) {
            unset($this->listeners[$eventName]);
        }
    }