public function build() {
        $this->prepareHandlers();
        $this->renderedCode = new RenderedCode();
        $this->renderedCode->setDirectives($this->buildDirectives())
                           ->setGlobalCode($this->buildGlobalCode())
                           ->setMainFunction($this->buildMainFunction());
        return $this;
    }