Cleaned up webserver code