refactoring pages module