A bit reworked pages handling