extracted display of pages to spa.js