protected function addHandler($event, callable $handler)
    {
        if (!isset($this->handlers[$event])) {
            throw new Exception("No such event '$event'");
        }

        if (!is_callable($handler)) {
            throw new Exception("Event handlers must be callable");
        }

        $this->handlers[$event][] = $handler;

        //Return last key
        return count($this->handlers[$event]) - 1;
    }