Move script to application.js