public function createNewPage($user, int $siteId, string $name, string $pageType, $data)
    {
        if (empty($user)) {
            throw new TrackingException('A valid user is required in ' . get_class($this));
        }
        $validatedData = $data;
        $pageData = [
            'name' => $name,
            'siteId' => $siteId,
            'pageTitle' => $validatedData['pageTitle'],
            'pageType' => $pageType, // "n" means "normal"
            'siteLayoutOverride' => (
                isset($validatedData['siteLayoutOverride']) ? $validatedData['siteLayoutOverride'] : null
            ),
            'createdByUserId' => $user->getId(),
            'createdReason' => 'New page in ' . get_class($this),
            'author' => $user->getName(),
        ];

        $createdPage = $this->pageRepo->createPage(
            $this->entityManager->find(Site::class, $siteId),
            $pageData
        );

        $this->immuteblePageVersionRepo->createUnpublished(
            new PageLocator(
                $siteId,
                $this->rcmPageNameToPathname->__invoke($createdPage->getName(), $createdPage->getPageType())
            ),
            $this->immutablePageContentFactory->__invoke(
                $createdPage->getPageTitle(),
                $createdPage->getDescription(),
                $createdPage->getKeywords(),
                $this->revisionRepo->find($createdPage->getStagedRevision())->getPluginWrappers()->toArray()
            ),
            $user->getId(),
            __CLASS__ . '::' . __FUNCTION__
        );

        return $createdPage;
    }