streamline javascript into app.js