renamed exported function to renderPage