Can we move this to a js file? I'd rather keep a separation and not have javascript lurking in our views.