code cleanup; moved application logic to app.js