refactor views to application.js