[major] Use error templates when we fail to render the page.
[codestyle] Comment clean up, clearer structure.