private function prepareNotAllowedResponse()
    {
        ob_clean();

        $this->response = new Response();
        $this->response->setResponseCode(ResponseCode::HTTP_METHOD_NOT_ALLOWED);

        $this->context->registerInstance($this->response);

        $this->filters->trigger(Filters::METHOD_NOT_ALLOWED, $this->context);

        $this->finalizeOutputBuffer();

        if (empty($this->response->getBody())) {
            $this->serveStaticPage('method_not_allowed');
        }
    }