Small changes in the code creating new pages, refactored stuff out of UI into core