Refactor the pages to receive the request as parameter