Refactoring page iterator class

- Removing duplicated code