Pages module: refactor new page js