code re-arranging to better allow for both the web browser and a request log