Accept the page_build event and refactor a ton.