Refactor PageFactory