Page rendering refactoring