Simplify check on number of pages