Refactor app.js to remove split()