refactored application.js