Refactor PageRenderer methods.
Fix bugs with event routing.
Global refactoring: join some methods to one helper module.
Refactor: re-use method.