public function insertNode(Page $page, Page $parent, $position, $section = false)
    {
        if (!$parent->hasMainSection()) {
            throw new InvalidArgumentException('Parent page is not a section.');
        }

        $current_parent = $page->getSection();
        $page->setParent($parent)
                ->setPosition($position)
                ->setLevel($parent->getSection()->getLevel() + 1);

        if (true === $section) {
            $page = $this->saveWithSection($page, $current_parent);
        } else {
            $this->shiftPosition($page, 1, true);
        }

        $parent->getSection()->setHasChildren(true);

        return $page;
    }