Tidying up the web pages and error handling