Major refactoring of the PAX layout
Minor refactorings, no functional changes
Started refactoring of the default layout