refactor pages