Cleaned up app.js code