Refactor preview and compile of area pages