public function action(Context $context = null)
    {
        $targetFunc = null;
        $classObject = null;
        
        // Create a dummy context if needed
        if (empty($context)) {
            $context = new Context();
        }

        // Determine target function
        if ($this->isCallable()) {
            $targetFunc = $this->getTarget();
        } else {
            $targetFunc = $this->translateToClassCallable($context);
            $classObject = $targetFunc[0];
        }

        // Route filter: before function
        if (!$this->filters->trigger(Filters::BEFORE_ROUTE, $context)) {
            return null;
        }
        
        $returnValue = null;
        $continue = true;

        // Execute a "before" function, if it is defined in the target class
        if ($classObject != null) {
            $beforeCallable = [$classObject, 'before'];

            if (is_callable($beforeCallable)) {
                $returnValue = $this->executeAction($beforeCallable, $context);

                if ($returnValue && $returnValue instanceof Response) {
                    // A respone was sent by the "before" function, stop execution
                    $continue = false;
                }
            }
        }

        if ($continue) {
            // Invoke the specified controller function or the specified callable with the appropriate params
            $returnValue = $this->executeAction($targetFunc, $context);
        }

        // Route filter: After function
        $this->filters->trigger(Filters::AFTER_ROUTE, $context);
        return $returnValue;
    }