Refactor page generation classes