Moved page creation to the addPages() method.