public function handle(
        string $method = null,
        string $path = null,
        $action,
        array $arguments = [],
        ContainerInterface $di = null
    ) {
        $this->di = $di;

        if (is_null($action)) {
            return;
        }

        if (is_callable($action)) {
            if (is_array($action)
                && is_string($action[0])
                && class_exists($action[0])
            ) {
                $action[] = $arguments;
                return $this->handleAsControllerAction($action);
            }
            return $this->handleAsCallable($action, $arguments);
        }

        if (is_string($action) && class_exists($action)) {
            $callable = $this->isControllerAction($method, $path, $action);
            if ($callable) {
                return $this->handleAsControllerAction($callable);
            }
        }

        if ($di
            && is_array($action)
            && isset($action[0])
            && isset($action[1])
            && is_string($action[0])
        ) {
            // Try to load service from app/di injected container
            return $this->handleUsingDi($action, $arguments, $di);
        }
        
        throw new ConfigurationException("Handler for route does not seem to be a callable action.");
    }