Factor out Page code