refactored application.js for output