refactor code related to Page
refactor code related to Outline
refactor code related to Document