improving the process of generating pages

@cberzan