Moved page generation to unique functions.

* Seperate functions for page1 and page2.