protected function handle($handler, $vars)
    {
        if (is_callable($handler)) {
            // The action is an anonymous function, let's execute it.
            return call_user_func_array($handler, $vars);
        } elseif (is_string($handler)) {
            //set default method to index
            if (!strpos($handler, '@')) {
                $handler = $handler.'@index';
            }

            list($controller, $method) = explode('@', $handler);

            $class = basename($controller);

            // The controller class was still not found. Throw Exception
            if (!class_exists($class)) {
                throw new RoutingException("{$class} not found");
            }

            // @TODO, pass constructor parameters functions
            $instance = new $class();

            //check method exist
            if (!method_exists($instance, $method)) {
                throw new RoutingException("{$class} does'nt have method {$method}");
            }

            return call_user_func_array(array($instance, $method), $vars);
        }
    }