add some DRYness to application.js