Source:
<code>public PageView build(final boolean rendered, final PageMode mode) throws DotDataException, DotSecurityException { final ContentletVersionInfo info = APILocator.getVersionableAPI(). getContentletVersionInfo(htmlPageAsset.getIdentifier(), htmlPageAsset.getLanguageId()); final HTMLPageAssetInfo htmlPageAssetInfo = getHTMLPageAssetInfo(info); final Template template = getTemplate(mode); final Language language = WebAPILocator.getLanguageWebAPI().getLanguage(request); final TemplateLayout layout = template != null && template.isDrawed() && !LicenseManager.getInstance().isCommunity() ? DotTemplateTool.themeLayout(template.getInode()) : null; final RenderParams params=new RenderParams(user,language, site, mode); request.setAttribute(RenderParams.RENDER_PARAMS_ATTRIBUTE, params); final User systemUser = APILocator.getUserAPI().getSystemUser(); if (!rendered) { final Collection<? extends ContainerRaw> containers = new PageContextBuilder(htmlPageAssetInfo.getPage(), systemUser, mode).getContainersRaw(); return new PageView(site, template, containers, htmlPageAssetInfo, layout); } else { final PageContextBuilder pcb = new PageContextBuilder(htmlPageAssetInfo.getPage(), systemUser, mode); <START> final Context velocityContext = pcb.addAll(VelocityUtil.getWebContext(request, response)); <END> final Collection<? extends ContainerRaw> containers = new ContainerRenderedBuilder(pcb.getContainersRaw(), velocityContext, mode).build(); final boolean canCreateTemplates = layoutAPI.doesUserHaveAccessToPortlet("templates", user); final String pageHTML = this.getPageHTML(); final boolean canEditTemplate = this.permissionAPI.doesUserHavePermission(template, PermissionLevel.EDIT.getType(), user); return new HTMLPageAssetRendered(site, template, containers, htmlPageAssetInfo, layout, pageHTML, canCreateTemplates, canEditTemplate, this.getViewAsStatus(mode) ); } }</code><technical_language>more descriptive names, pcb -> pageContextBuilder</technical_language>

Target:
public PageView build(final boolean rendered, final PageMode mode) throws DotDataException, DotSecurityException { final ContentletVersionInfo info = APILocator.getVersionableAPI(). getContentletVersionInfo(htmlPageAsset.getIdentifier(), htmlPageAsset.getLanguageId()); final HTMLPageAssetInfo htmlPageAssetInfo = getHTMLPageAssetInfo(info); final Template template = getTemplate(mode); final Language language = WebAPILocator.getLanguageWebAPI().getLanguage(request); final TemplateLayout layout = template != null && template.isDrawed() && !LicenseManager.getInstance().isCommunity() ? DotTemplateTool.themeLayout(template.getInode()) : null; final RenderParams params=new RenderParams(user,language, site, mode); request.setAttribute(RenderParams.RENDER_PARAMS_ATTRIBUTE, params); final User systemUser = APILocator.getUserAPI().getSystemUser(); if (!rendered) { final Collection<? extends ContainerRaw> containers = new PageContextBuilder(htmlPageAssetInfo.getPage(), systemUser, mode).getContainersRaw(); return new PageView(site, template, containers, htmlPageAssetInfo, layout); } else { final PageContextBuilder pageContextBuilder = new PageContextBuilder(htmlPageAssetInfo.getPage(), systemUser, mode); final Context velocityContext = pageContextBuilder.addAll(VelocityUtil.getWebContext(request, response)); final Collection<? extends ContainerRaw> containers = new ContainerRenderedBuilder(pageContextBuilder.getContainersRaw(), velocityContext, mode).build(); final boolean canCreateTemplates = layoutAPI.doesUserHaveAccessToPortlet("templates", user); final String pageHTML = this.getPageHTML(); final boolean canEditTemplate = this.permissionAPI.doesUserHavePermission(template, PermissionLevel.EDIT.getType(), user); return new HTMLPageAssetRendered(site, template, containers, htmlPageAssetInfo, layout, pageHTML, canCreateTemplates, canEditTemplate, this.getViewAsStatus(mode) ); } }