Cleanup code in web.js