Bug: better code for generation of all pages