DRY-ification by using helper funtion to return web page titles