reworked pages functionality