More refactoring. Ready to reconstruct pages in new environment.