refactoring: pages.js(ongoing)