refactor and remove logging from app.js