Factored out common code from each page function into an
authenticatedPage function