clean up allPages.js a little