refactoring page management